package e2q.liferay.domain;

import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
// default package



/**
 * E2qLiUserGroupRoleId entity. @author MyEclipse Persistence Tools
 */

public class E2qLiUserGroupRoleId  implements java.io.Serializable {


    // Fields    

     private E2qLiUser user;
     private E2qLiGroup group;
     private E2qLiRole role;


    // Constructors

    /** default constructor */
    public E2qLiUserGroupRoleId() {
    }
	@ManyToOne
	@JoinColumn(name = "userId")
   public E2qLiUser getUser() {
		return user;
	}

	public void setUser(E2qLiUser user) {
		this.user = user;
	}
	@ManyToOne
	@JoinColumn(name = "groupId")
	public E2qLiGroup getGroup() {
		return group;
	}

	public void setGroup(E2qLiGroup group) {
		this.group = group;
	}
	@ManyToOne
	@JoinColumn(name = "roleId")
	public E2qLiRole getRole() {
		return role;
	}

	public void setRole(E2qLiRole role) {
		this.role = role;
	}


public boolean equals(Object other) {
         if ( (this == other ) ) return true;
		 if ( (other == null ) ) return false;
		 if ( !(other instanceof E2qLiUserGroupRoleId) ) return false;
		 E2qLiUserGroupRoleId castOther = ( E2qLiUserGroupRoleId ) other; 
         
		 return ( (this.user.getUserId()==castOther.user.getUserId()) || ( this.user.getUserId()!=null && castOther.user.getUserId()!=null && this.user.getUserId().equals(castOther.user.getUserId()) ) )
 && ( (this.group.getGroupId()==castOther.group.getGroupId()) || ( this.group.getGroupId()!=null && castOther.group.getGroupId()!=null && this.group.getGroupId().equals(castOther.group.getGroupId()) ) )
 && ( (this.role.getRoleId()==castOther.role.getRoleId()) || ( this.role.getRoleId()!=null && castOther.role.getRoleId()!=null && this.role.getRoleId().equals(castOther.role.getRoleId()) ) );
   }
   
   public int hashCode() {
         int result = 17;
         
         result = 37 * result + ( this.user.getUserId() == null ? 0 : this.user.getUserId().hashCode() );
         result = 37 * result + ( this.group.getGroupId() == null ? 0 : this.group.getGroupId().hashCode() );
         result = 37 * result + ( this.role.getRoleId() == null ? 0 : this.role.getRoleId().hashCode() );
         return result;
   }   





}